<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <style>
            div {
                width: 200px;
                height: 200px;
                border: 1px solid red;
                /* 设置超出部分的显示方式 */
                overflow: scroll;
            }
            img {
                width: 100px;
                /* 设置行内元素的垂直对齐方式 top上对齐 middle中间对齐  bottom下对齐  baseline基线对齐(默认) */
                vertical-align: baseline;
            }
        </style>
    </head>
    <body>
        <input type="text" /><img src="../2.jpg" alt="" />
        <div><img src="../2.jpg" alt="" /></div>
    </body>
</html>
